import service from '../utils/request.js';

/**
 * 授权登录
 * @param {object} data 
 */
export function login(data) {
  data.loginMethod = getApp().globalData.systemInfo.system.includes('iOS') ? 1 : 0;
  return service({
    url: 'sys/login',
    method: 'POST',
    isError: true,
    data
  })
}
/**
 * 获取首页车辆信息
 */
export function listVehicle(){
  return service({
    url: 'home/listVehicle',
    method: 'GET'
  })
}

/**
 * 获取验证码
 * @param {string} mobile 
 */
export function getAuthCode(mobile) {
  return service({
    url: 'common/authcode',
    method: 'PUT',
    data: {
      mobile,
      type: 3
    }
  })
}
